<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title> {lang members} </title>
    {template _meta.html}
  </head>
  
  <body>  
    
    {template _header.html}

    <div class="container">
      {template _search.html}
      <div class="left">
        {template _recentraid.html}
      </div>
      <div class="right">
        <div class="tabtitle">
          <div class="floatl">{lang member_title}</div>
          <div class="floatr normal">
            <form method="post" action="" id="SLT" name="SLT">
            {lang select_dkp}:
            <select name="typeid" onChange="changeSLT()">
              <option value="0">--{lang select_dkp}--</option>
              <!--{loop $dkptypes $_ $v}-->
                <!--{if $v['type_id']==$_REQUEST['typeid']}-->
                <option value="{$v['type_id']}" selected="true">{$v['type_name']}</option>
                <!--{else}-->
                <option value="{$v['type_id']}">{$v['type_name']}</option>
                <!--{/if}-->              
              <!--{/loop}-->
            </select>
            {lang select_class}:
            <select name="classid" onChange="changeSLT()">
              <option value="0">--{lang all}--</option>
              <!--{loop $classes $_ $v}-->
                <!--{if $v['class_id']==$_REQUEST['classid']}-->
                <option value="{$v['class_id']}" selected="true">{$v['class_name']}</option>
                <!--{else}-->
                <option value="{$v['class_id']}">{$v['class_name']}</option>
                <!--{/if}-->              
              <!--{/loop}-->
            </select>
            {lang select_size}
            <select name="size" onChange="changeSLT()">
              <option value="-1" {if $_REQUEST['size']=='-1'}selected="true"{/if}>{lang all}</option>
              <option value="12" {if $_REQUEST['size']=='12'}selected="true"{/if}>12</option>
              <option value="25" {if $_REQUEST['size']=='25'}selected="true"{/if}>25</option>
              <option value="50" {if $_REQUEST['size']=='50'}selected="true"{/if}>50</option>
            </select>            
            </form>
          </div>
        </div>
        <table class="table">
          <thead>
            <tr>
              <th style="width:30px;">ID</th>
              <th style="width:120px;">{lang member_name}</th>
              <th style="width:55px;">{lang member_race}</th>
              <th style="width:55px;">{lang member_class}</th>
              <th style="width:30px;">{lang member_level}</th>              
              <th style="width:40px;">{lang member_earn}</th>
              <th style="width:40px;">{lang member_spent}</th>
              <th style="width:50px;">{lang member_current}</th>
              <th style="width:48px;">{lang member_frequency}</th>
              <th style="width:64px;">{lang member_lastraid}</th>
            </tr>        
          </thead>
          <tbody>
            <!--{loop $members $i $v}-->
            <tr class="tr{echo $i%2}">
              <td>{$v['member_id']}</td>
              <td class="bold">
                {if $v['race_en']}<span class="{$v['race_en']}"></span>{/if} 
                {if $v['class_en']}<span class="{$v['class_en']}"></span>{/if} 
                <a href="{echo U('|member_details|id='.$v['member_id'])}">
                <span style="{if $v['class_color']}color:{$v['class_color']};{/if}">{$v['member_name']}</span>
                </a>
              </td>
              <td>{$v['member_race']}</td>
              <td><span style="{if $v['class_color']}color:{$v['class_color']};{/if}">{$v['member_class']}</span></td>
              <td>{$v['member_level']}</td>                
              <td>{echo number_format($v['dkp_earn'],2,'.','')}</td>
              <td>{echo number_format($v['dkp_spent'],2,'.','')}</td>
              <td class="bold txtr">{echo setcolor(number_format($v['dkp_base']+$v['dkp_adjust']+$v['dkp_earn']-$v['dkp_spent'],2,'.',''))}</td>
              <td class="txtc">{echo number_format($v['raidcount']*100/$raidtotal,2,'.','')}%</td>
              <td>{echo ($v['lastraid'] ? date('Y-m-d',$v['lastraid']) :'')}</td>
            </tr>
            <!--{/loop}-->
          </tbody>
        </table>
      </div>
    </div>
    
    {template _footer.html}

    <script>
    
        $(".table tr").hover(function() {
          if ($(this).hasClass('trhover'))
            $(this).removeClass('trhover');
          else
            $(this).addClass('trhover');          
        });
        
        function changeSLT() {
          $('#SLT').submit();
        }
        
    </script>
    
  </body>
</html>